home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PROGEDIT
/
3458B.ZIP
/
AMAC44B.ZIP
/
RFR003.QM
< prev
next >
Wrap
Text File
|
1992-06-22
|
41KB
|
876 lines
* rfr003.qm
* Macros To Format
* Written By Tom Hogshead
* [ See RFRMxx.QM For Use ]
* 6/22/92
*
* Key Subfile Description Bytes
* ===== ======== =============================================== =====
* @3 - Formats Commented or Uncommented Paragraph, ( ) 157 |chg
* Reverses Commenting
*
* @4 - Formats Commented or Uncommented Paragraph, 158 |chg
* Leaves Paragraph Commenting 'As Is'
*
* Format Paragraph With or W/O Multiple Indentions
* @f5 - To Current Rt Margin and Lft Margin Col 1 36
* @f6 - Pauses For User Selected Lft and Rt Margins 111
* @f7 - Without Pause To Lft and Rt Margins 102
* Set With @f6, @f8 or Last GoToColumn 'nn'
*
* @f9 - Format Paragraph With No Multiple Indentions 52
* Without Pause To Lft and Rt Margins
* Set With @f8, @f6 or Last GoToColumn 'nn'
*
* @f8 - Format Lines In Any Type Block, 111
* Pauses For User Selected Lft and Rt Margins
*
* Format Lines In Any Type Block
* To Current Rt Margin Setting
* @8 - Small Version < BEST > 33
* @5 - Uses Temp File, Technique only 96
*
* @7 - Format Paragraph To Current Rt Margin Setting 8
* @9 - Format File To Current Rt Margin Setting 10
* @2 - Format Column Block To a Rt Margin of 60 54
*
* Format ONLY Lines Wider Than Rt Margin 80
* @f1 - QEdit v2.15 Only (Fast) < BEST >
* @f2 - QEdit v2.10 or 2.15 (Slow)
*
* @0 GENERIC Macro To Process Blocks
*
* ^f7 Format Message Reader Messages (Tim Farley)
* @8 {e:\up\msg002} - Format Message Reader Messages--I use this macro!
*
* (Fix) For Different Qconfig Settings
* To Insert Blocks Above/Below Cursor Line
*
* {e:\up\RFRM*}--Return To RFRMxx.QM
*
*-- eoi
* M A C R O S
* ----------------------------------------------------------------------
* @(2) Format Column Block To Right Margin of 60
* ----------------------------------------------------------------------
* This macro will format an open or closed column block marked
* before invoking to a right mardin of 60.
@2 MacroBegin
setscreenoff * Remove if not v2.15
editfile "nul" return quit * Quit nul if loaded
GotoBlockBeg JFalse END
EditFile Return * Load empty nul file
moveblock
SetRmargin "60" Return
WRAP: wrappara nextpara jtrue WRAP * Format all para's
SetRmargin "80" Return
GotoColumn "512" Return markcolumn begfile * Make wide col blk
Copy Quit
cursorright * Paste with space
PasteOver MakeCtrOfScreen
END:
UnmarkBlock
*
* 54 bytes Thu 12-19-1991 13:21:42 (TH @2)
*
* ----------------------------------------------------------------------
* @(3) Formats Commented or Uncommented Paragraph,
* Reverses Commenting,
* Replaces "period space" with "period two spaces"
* ----------------------------------------------------------------------
* This macro formats a paragraph to a column width of 69. Before macro
* execution the paragraph may either be commented with an asterisk and
* space in column 1 or uncommented. All occurrences in the paragraph
* of "period space" are replaced with "period two spaces". If the
* paragraph has already been commented before macro execution, it is
* formatted and uncommented. If the paragraph has not already been
* commented, it is formatted and commented. Invoking this macro twice
* will return the paragraph to it's original commented or uncommented
* state, but formatted. This macro will not work correctly if blank
* lines are commented.
* To run, invoke @3 with the cursor located anywhere in a paragraph.
* If the cursor is located between paragraphs, the previous paragraph
* is formatted. After this macro ends, the cursor is returned to the
* beginning of the formatted paragraph. The user may insert 'nextpara'
* at the end of the macro to return the cursor to the beginning of the
* next paragraph after macro execution. Macro requires QEdit v2.15.
@3 macrobegin
setscreenoff
unmarkblock
setrmargin "69" return
cursordown prevpara begline
markcharacter endpara markcharacter prevpara
* ------ Insert Empty Line if Paragraph Includes Title Box ------*
END_TITLE_BOX:
find '* ---' return 'L' return
jtrue END_TITLE_BOX
cursorup
find return 'L' return
jfalse START
addline
nextpara markcharacter
endpara markcharacter
prevpara
START:
insertline cursordown * Insert blank line on top
* ------------- Check if paragraph already commented -------------*
cursordown
begline
cursorright
find "*" return "LB" return
Jfalse COMMENT
* ---------------- Uncomment And Format Paragraph ----------------*
UNCOMMENT:
shiftleft shiftleft
gotoblockbeg
wrappara
prevpara
jump FORMATTED
* ----------------- Comment And Format Paragraph -----------------*
COMMENT:
gotoblockbeg *:17
wrappara
gotoblockend
shiftright shiftright
begline
unmarkblock markcolumn
prevpara
begline markcolumn
fillblock '*' return
markline
endpara
markline
prevpara *:17
FORMATTED:
* ------ Move Paragraph to Bottom of Title Box if it Exists ------*
cursorup
isemptyline jfalse 1 *:17
delline
1: *:17
cursorup cursorup
markline
find '---' return 'L' return
jfalse NO_TITLE
cursordown
isemptyline jfalse REPOS *:17
delline
jump REPOS
NO_TITLE:
cursordown cursordown
REPOS:
* ------- Replaces "Period Space" With "Period two spaces" -------*
findreplace ". " return ". " return "LN" return
findreplace ". " return return "LN" return
END:
begline
unmarkblock
makectrofscreen
*
* 97 bytes Thu 08-08-1991 14:03:38 (TH @3, in rfr003.qm)
* 98 bytes Tue 12-10-1991 06:29:28 (TH @3, added begline for line 1)
* 95 bytes Tue 12-10-1991 06:45:16 (TH @3, removed jfalse END)
* 96 bytes Tue 12-10-1991 06:51:08 (TH @3, added setscreenoff)
* 157 bytes Mon 06-15-1992 17:06:07 (TH @3, for para next to title box)
* 167 bytes Wed 06-17-1992 11:36:30 (TH @3, corrected)
* 167 bytes Wed 06-17-1992 11:42:35 (TH @3)
*
* ----------------------------------------------------------------------
* @(4) Formats Commented or Uncommented Paragraph,
* Leaves Paragraph Uncommenting As Is,
* Replaces "period space" With "period two spaces"
* ----------------------------------------------------------------------
* This macro formats a paragraph that is either commented with an
* asterisk and space in column 1 or uncommented, to a column width of
* 69, and replaces "period space" with "period two spaces". This
* macro differs from @3 in that @4 does not change the commented state
* of the paragraph, i.e. it leaves a commented paragraph commented
* after reformatting and an uncommented paragraph uncommented, but
* commented.
* To run, invoke @4 with the cursor located anywhere in the paragraph.
* If the cursor is located between paragraphs, the previous paragraph
* is formatted. After this macro ends, the cursor is returned to the
* beginning of the formatted paragraph. The user may insert 'nextpara'
* at the end of the macro to return the cursor to the beginning of the
* next paragraph after macro execution. Macro requires QEdit v2.15.
@4 macrobegin
setscreenoff
unmarkblock
setrmargin "69" return
cursordown prevpara begline
markcharacter endpara markcharacter prevpara
* ------ Insert Empty Line if Paragraph Includes Title Box ------*
END_TITLE_BOX:
find '* ---' return 'L' return
jtrue END_TITLE_BOX
cursorup
find return 'L' return
jfalse START
addline
nextpara markcharacter
endpara markcharacter
prevpara
START:
insertline cursordown * Insert blank line on top
* ------------- Check if paragraph already commented -------------*
cursordown
begline
cursorright
find "*" return "LB" return
jtrue UNCOMMENT
* Jfalse COMMENT
gotoblockbeg *:17
wrappara
prevpara
jump FORMATTED
* ---------------- Uncomment And Format Paragraph ----------------*
UNCOMMENT:
shiftleft shiftleft
wrappara
prevpara
* jump FORMATTED
* ----------------- Comment NO Format Paragraph -----------------*
COMMENT:
* wrappara
gotoblockend
shiftright shiftright
begline
unmarkblock markcolumn
prevpara
begline markcolumn
fillblock '*' return
markline
endpara
markline
prevpara *:17
* gotoblockbeg
FORMATTED:
* ------ Move Paragraph to Bottom of Title Box if it Exists ------*
cursorup
isemptyline jfalse 1 *:17
delline * Remove blank line
1: *:17
cursorup cursorup
markline
find '---' return 'L' return
jfalse NO_TITLE
cursordown
isemptyline jfalse REPOS *:17
delline * Delete blank between para/title
jump REPOS
NO_TITLE:
cursordown cursordown
REPOS:
* ------- Replaces "Period Space" With "Period two spaces" -------*
findreplace ". " return ". " return "LN" return
findreplace ". " return return "LN" return
END:
begline
unmarkblock
makectrofscreen
*
* 97 bytes Thu 08-08-1991 14:24:28 (TH @4, in rfr003.qm)
* 96 bytes Wed 12-18-1991 17:55:19 (TH @4)
* 96 bytes Wed 12-18-1991 20:36:35 (TH @4)
* 158 bytes Mon 06-15-1992 17:05:34 (TH @4, for para next to title box)
* 167 bytes Wed 06-17-1992 11:36:15 (TH @4, corrected)
* 167 bytes Wed 06-17-1992 11:42:16 (TH @4)
*
* ----------------------------------------------------------------------
* @(5) Format All Lines Containing Any Type Block,
* Uses Temp File, Requires QEdit v2.15
* ----------------------------------------------------------------------
* This macro will format all lines containing any type open or closed
* block to current right margin. If a block is not marked before
* execution, cursor down to the end of the desired block and press
* <enter> after invoking. This macro operates irrespective of all
* toggles and qconfig settings. See @8 for small version of this
* macro.
@5 macrobegin onewindow
cursorright gotoblockend jtrue A markline
gotoblockend jtrue OK makectrofscreen Pause jump B
A: gotoblockbeg unmarkblock markline prevposition
B: markline
OK: setscreenoff * Remove if not v2.15
addline 10 * Change if needed
editfile "NUL" return quit gotoblockbeg cut
paste fillblock " " return
horizontalwindow editfile return paste * Paste block to nul
gotoblockend cursordown jtrue DEL begfile * (fix) for diff qconfig
DEL: endline begline jtrue NEXT * Test if line is empty
delline * Delete extra line
NEXT:
*--<<<< Process block >>>>
gotoblockbeg * Position to format
WRAP: wrappara nextpara jtrue WRAP * Format all para's
begfile unmarkblock markcolumn
endfile gotocolumn "512" return
cut quit
prevwindow onewindow pasteover * Paste block back
gotoblockend cursordown CURSORDOWN *|b
LOOP: delline endline begline jfalse LOOP * Removes extra lines
DONE: unmarkblock
* DONE: insertline nextpara unmarkblock * Use this line to insertline
* gotoblockbeg unmarkblock * Use this line to end at block begin
*
* 95 bytes Wed 12-18-1991 17:11:06 (TH @5)
* 94 bytes Wed 01-01-1992 15:09:31 (TH @5, shortened)
* 95 bytes Fri 04-24-1992 12:18:09 (TH @5, corrected)
* 96 bytes Tue 04-28-1992 10:33:52 (TH @5, ins/keep empty line at eob +|b)
*
* ----------------------------------------------------------------------
* @(7) Format Paragraph
* ----------------------------------------------------------------------
@7 Macrobegin Cursordown Prevpara Wrappara Nextpara
*
* 8 bytes Thu 08-08-1991 14:02:17 (TH @7)
*
* ----------------------------------------------------------------------
* @(8) Format All Lines Containing Any Type Block, Small Version of @5,
* Requires QEdit v2.15
* ----------------------------------------------------------------------
* This macro will format all lines containing any type open or closed
* block to current right margin. If a block is not marked before
* execution, cursor down to the end of the desired block and press
* <enter> after invoking. This macro will fit on one line of
* qconfig.dat and operates irrespective of all toggles and qconfig
* settings.
@8 macrobegin
cursorright gotoblockbeg jtrue A
markline gotoblockbeg jtrue OK pause jump B
A: gotoblockend unmarkblock markline prevposition
B: markline
OK: setscreenoff addline gotoblockbeg
WRAP: wrappara iscursorinblock jtrue WRAP
delline unmarkblock
*
* 36 bytes Wed 12-18-1991 15:43:57 (TH @8, to JM #20/66)
* 33 bytes Tue 12-31-1991 18:22:17 (TH @8, shortened)
*
* ----------------------------------------------------------------------
* @(9) Format File
* ----------------------------------------------------------------------
@9 MacroBegin Begfile FORMAT: WrapPara NextPara jtrue FORMAT
*
* 26 bytes Wed 09-12-1990 16:47:
* 10 bytes Wed 12-04-1991 10:57:45 (TH @9, shortened)
*
* ----------------------------------------------------------------------
* @(0) Generic Macro To Process Blocks
* ----------------------------------------------------------------------
* This macro is useful for processing a block and returning to the
* original marked processed block. Insert commands to process any type
* block below the line <<<< Process block >>>>. An example using this
* generic macro is in @5 to format all lines marked as a block.
* See @8 and @t in rfr002.qm for a block processing technique not using
* temporary files; block is moved to and processed at the end of the
* current file.
@0 macrobegin
onewindow
cursorright gotoblockend jtrue A markline
gotoblockend jtrue OK makectrofscreen Pause jump B
A: gotoblockbeg unmarkblock markline prevposition
B: markline
OK:
setscreenoff * Remove if not v2.15
addline 10 * Change if needed
editfile "NUL" return quit gotoblockbeg cut
paste fillblock " " return
horizontalwindow editfile return paste * Paste block to nul
gotoblockbeg cursorup jtrue DEL endfile * (fix) for diff qconfig
DEL: endline begline jtrue NEXT * Test if empty
delline * Delete extra line
NEXT:
gotoblockbeg
*--<<<< Process block >>>>
begfile unmarkblock markcolumn
endfile gotocolumn "512" return
cut quit
prevwindow onewindow pasteover * Paste block back
gotoblockend cursordown
LOOP: delline endline begline jfalse LOOP * Removes extra lines
DONE: gotoblockbeg * unmarkblock
*
* 89 bytes Wed 12-18-1991 13:17:20 (TH @0)
* 88 bytes Wed 12-18-1991 17:11:47 (TH @0, keep block marked)
* 86 bytes Mon 12-30-1991 13:32:03 (TH @0, shortened)
* 90 bytes Wed 01-01-1992 15:11:14 (TH @0, for all qconfig's)
*
* ----------------------------------------------------------------------
* @(f1) Reformat ONLY Lines Wider Than Right Margin 80, QEdit 2.15 Only
* ----------------------------------------------------------------------
@f1 macrobegin
setscreenoff
LOOP:
gotocolumn "80" return isendline jtrue NOWRAP
addline cursorup wrappara delline
jump LOOP
NOWRAP:
cursordown jfalse END
isemptyline jfalse LOOP
END:
*
* 33 bytes Mon 03-30-1992 18:49:35 (TH @f1, HD #21/5235)
* 30 bytes Tue 03-31-1992 15:35:11 (TH @f1, shortened)
*
* ----------------------------------------------------------------------
* @(f2) Reformat ONLY Lines Wider Than Right Margin 80, QEdit v2.10 or 2.15
* ----------------------------------------------------------------------
@f2 macrobegin
LOOP:
endline #173 gotocolumn "80" return
find #173 return delline return jfalse NOWRAP
delch addline cursorup wrappara delline
jump LOOP
NOWRAP:
find return "g" return delch
cursordown jfalse END
endline begline jtrue LOOP
END:
*
* 48 bytes Mon 03-30-1992 19:08:29 (TH @f2, HD #21/5235)
* 45 bytes Tue 03-31-1992 15:35:26 (TH @f2, shortened)
*
* ----------------------------------------------------------------------
* @(f5) Format Paragraph With or W/O Multiple Indentions
* To The Current Right Margin Setting and Left Margin Column 1
* ----------------------------------------------------------------------
* This macro will format to the current right margin setting and a left
* margin of column 1 a paragraph with or without multiple indentions.
* The paragraph must be separated by blank lines from the first blank
* line above the cursor line to the next blank line below the cursor
* line. Non-indented lines *must* be in column 1. Macro requires QEdit
* v2.15. This macro was written at the request of Jim Bates in a
* SmartNet echo Message on SemWare Conference 23, Message # 1468,
* 4-28-92.
* If non-indented lines do not begin in col 1, a paragraph containing
* multiple indentions may be formatted with a left margin of 1 using
* @f7 below by changing the last gotocolumn return line in @f7 to
* gotocolumn "1" return or just begline. This revised macro will be
* considerably longer than @f5, but the added versatility may be worth
* it.
* For example, with the cursor anywhere in the following three
* indented paragraphs without the asterisks, and a right margin setting
* of 55:
* This:
* This is parapraph 1 to format all lines of a paragraph containing
* multiple indentions to user selected left and right margins.
* This is parapraph 2 to format all lines of a paragraph containing
* multiple indentions to user selected left and right margins.
* This is parapraph 3 to format all lines of a paragraph containing
* multiple indentions to user selected left and right margins.
* Becomes this:
* This is parapraph 1 to format all lines of a
* paragraph containing multiple indentions to user
* selected left and right margins.
* This is parapraph 2 to format all lines of a
* paragraph containing multiple indentions to user
* selected left and right margins.
* This is parapraph 3 to format all lines of a
* paragraph containing multiple indentions to user
* selected left and right margins.
@f5 macrobegin
setscreenoff * Turn off screen 'till done
endpara * Move to end of para
addline cursorup * Add line in case we're at eof
unmarkblock markline * Mark end of para
prevpara markline * Mark all indented para's to reformat
SPLIT: cursordown * Move down one line from indent
iscursorinblock jfalse TOP * Begin format when we're out of block
firstnonwhite * Move to first char on line
isbegline jtrue SPLIT * Test if we're on indent
insertline cursordown * Insert line if not on indent
jump SPLIT * Continue 'til all para's are split
TOP: gotoblockbeg * Go to first indented line
WRAP: wrappara * Format each split para
delline * Delete extra blank line
iscursorinblock jtrue WRAP * Continue until we're out of block
unmarkblock * Unmark block
nextpara * Pos on next para
*
* 36 bytes Sat 05-02-1992 13:33:00 (TH @6, to JB #20/1474 as @6)
* 36 bytes Thu 05-07-1992 14:55:05 (TH @f5, changed key from @6)
* 36 bytes Thu 05-14-1992 21:34:02 (TH @f5, to JB #23/1491 -93)
*
* ----------------------------------------------------------------------
* @(f6) Format Paragraph With or W/O Multiple Indentions
* To User Selected Left and Right Margins, Requires QEdit v2.15
* ----------------------------------------------------------------------
* This macro will format to a user selected left and right margins a
* paragraph with or without multiple indentions. The paragraph must be
* separated by blank lines from the first blank line above the cursor
* line to the next blank line below the cursor line. Macro requires
* QEdit v2.15.
* At the first pause change or accept the left margin at the "goto
* column" prompt. At the second pause change or accept the right
* margin setting.
* The following paragraph, without the asterisks and leading single
* spaces and with a user selected left margin of 15 and a right margin
* of 55:
* This is parapraph 1 to format all lines of a paragraph containing
* multiple indentions to user selected left and right margins.
* This is parapraph 2 to format all lines of a paragraph containing
* multiple indentions to user selected left and right margins.
* This is parapraph 3 to format all lines of a paragraph containing
* multiple indentions to user selected left and right margins.
* Formats to:
* This is parapraph 1 to format all
* lines of a paragraph containing multiple
* indentions to user selected left and
* right margins.
* This is parapraph 2 to format all
* lines of a paragraph containing multiple
* indentions to user selected left and
* right margins.
* This is parapraph 3 to format all
* lines of a paragraph containing multiple
* indentions to user selected left and
* right margins.
@f6 macrobegin savesettings setautoindentmode setsoundoff setinsmode
* ------------------------ Mark Paragraph ------------------------*
setscreenoff * Turn off screen 'til done
endpara * Move to end of para
addline cursorup * Add line in case we're at eof
unmarkblock markline * Mark end of para
prevpara markline * Mark all indented para's to reformat
gotoblockend
* --- Convert Line Block To Column Block (From @3 mis003.qm ) ---*
1: begline addline "*" #173 gotoblockbeg
2: isemptyline jfalse 3 cursordown jump 2
3: firstnonwhite markcolumn endline cursorleft
4: cursordown isemptyline jtrue 4 isendline jtrue 5 endline cursorleft
5: markcolumn
Find "*" #173 return delline return jfalse 6
prevposition firstnonwhite iscursorinblock jtrue 4 markcolumn jump 4
6: delline insertline gotoblockbeg * Delete end of block marker
* --------------- Move Block Temporarily To Col 1 ---------------*
begline moveblock
* ---------------- Split Paragraph at Indentions ----------------*
SPLIT: cursordown * Move down one line from indent
iscursorinblock jfalse TOP * Begin format when we're out of block
firstnonwhite * Move to first char on line
isbegline jtrue SPLIT * Test if we're on indent
insertline cursordown * Insert line if not on indent
jump SPLIT * Continue 'til all para's are split
TOP: gotoblockbeg * Pos to format
* ------------- Select or Accept Left/Right Margins -------------*
setscreenon
toggleinsert * Toggle Insert Off to overwrite
gotocolumn begline pause return * Select or accept left margin
setrmargin begline pause return * Select or accept right margin
setscreenoff
* ------------ Move Block, Reformat, Rejoin at Splits ------------*
moveblock * Move block to left margin setting
WRAP: wrappara * Format each split para
delline * Delete blank line caused by split
iscursorinblock jtrue WRAP * Continue until we're out of block
delline * Delete extra blank line
unmarkblock * Unmark block
nextpara * Pos on next para
*
* 111 bytes Thu 05-07-1992 17:45:40 (TH @f6)
* 111 bytes Thu 05-14-1992 21:35:06 (TH @f6, to JB #23/1491 -93)
*
* ----------------------------------------------------------------------
* @(f7) Format Paragraph With or W/O Multiple Indentions
* Without Pause To User Selected Left and Right Margins
* Set With @f6, @f9 or Last GoToColumn 'nn'
* ----------------------------------------------------------------------
* This macro will format without pause all lines of a paragraph
* with or without multiple indentions to left and right margins either
* set after invoking @f6 at least one time or setting the left margin
* with gotocolumn 'nn' return. It differs from macro @f6, which
* enables to the user to select margins at the pause's. See @f6 for
* example.
@f7 macrobegin savesettings setautoindentmode setsoundoff setinsmode
* ------------------------ Mark Paragraph ------------------------*
setscreenoff * Turn off screen 'til done
endpara * Move to end of para
addline cursorup * Add line in case we're at eof
unmarkblock markline * Mark end of para
prevpara markline * Mark all indented para's to reformat
* --- Convert Line Block To Column Block (From @3 mis003.qm ) ---*
gotoblockend
1: begline addline "*" #173 gotoblockbeg
2: isemptyline jfalse 3 cursordown jump 2
3: firstnonwhite markcolumn endline cursorleft
4: cursordown isemptyline jtrue 4 isendline jtrue 5 endline cursorleft
5: markcolumn
Find "*" #173 return delline return jfalse 6
prevposition firstnonwhite iscursorinblock jtrue 4 markcolumn jump 4
6: delline insertline gotoblockbeg * Delete end of block marker
* --------------- Move Block Temporarily To Col 1 ---------------*
begline moveblock
* ---------------- Split Paragraph at Indentions ----------------*
SPLIT: cursordown * Move down one line from indent
iscursorinblock jfalse TOP * Begin format when we're out of block
firstnonwhite * Move to first char on line
isbegline jtrue SPLIT * Test if we're on indent
insertline cursordown * Insert line if not on indent
jump SPLIT * Continue 'til all para's are split
TOP: gotoblockbeg * Pos to format
* ------------ Move Block, Reformat, Rejoin at Splits ------------*
gotocolumn return * Pos at gotocolumn setting
moveblock * Move block to left margin setting
WRAP: wrappara * Format each split para
delline * Delete blank line caused by split
iscursorinblock jtrue WRAP * Continue until we're out of block
delline * Delete extra blank line
unmarkblock * Unmark block
nextpara * Pos on next para
*
* 102 bytes Thu 05-07-1992 17:45:18 (TH @f7)
* 102 bytes Thu 05-14-1992 21:35:28 (TH @f7, to JB #23/1491 -93)
*
* ----------------------------------------------------------------------
* @(f8) Format All Lines Containing Any Type Block
* To User Selected Left and Right Margins, Requires QEdit v2.15
* ----------------------------------------------------------------------
* This macro will format all lines containing any type open or
* closed block to user selected left and right margins. If a block is
* not marked before execution, at the first pause cursor down to the
* end of the desired block and press <enter>. At the second pause
* change or accept the left margin at the "goto column" prompt. At the
* third pause change or accept the right margin setting. This macro
* will not work with paragraphs containing multiple indentions like
* @f5-F7 above.
* To format all lines in a file to a user selected left and right
* margins, mark the file as a line block. For large files, this macro
* can be very slow because of the routine to convert to a column block.
* The first paragraph, without the asterisks and leading single
* spaces, formats with a left margin of 15 and a right margin of 55 to:
* This macro will format all lines
* containing any type open or closed block
* to user selected left and right margins.
* If a block is not marked before
* execution, at the first pause cursor down
* to the end of the desired block and press
* <enter>. At the second pause enter or
* accept the left margin at the "goto
* column" prompt. At the third pause enter
* or accept the right margin setting.
@f8 macrobegin savesettings setautoindentmode setsoundoff setinsmode
* -------- Select And Mark Block To Format If Not Marked --------*
gotoblockend jtrue A markline gotoblockend jtrue OK pause jump B *|
A: gotoblockbeg unmarkblock markline prevposition *|b
B: markline gotoblockend *|
OK: setscreenoff
* --- Convert Line Block To Column Block (From @3 mis003.qm ) ---*
1: begline addline "*" #173 gotoblockbeg *|b
2: isemptyline jfalse 3 cursordown jump 2
3: firstnonwhite markcolumn endline cursorleft
4: cursordown isemptyline jtrue 4 isendline jtrue 5 endline cursorleft
5: markcolumn
Find "*" #173 return delline return jfalse 6
prevposition firstnonwhite iscursorinblock jtrue 4 markcolumn jump 4
6: delline insertline gotoblockbeg * Delete end of block marker
* ------------- Select or Accept Left/Right Margins -------------*
setscreenon
toggleinsert * Toggle Insert Off to overwrite
begline * In case left margin not entered
gotocolumn begline pause return * Select or accept left margin
setrmargin begline pause return * Select or accept right margin
* ------------------- Move Block And Reformat -------------------*
setscreenoff moveblock * Move block to left margin setting
WRAP: wrappara * Format
iscursorinblock jtrue WRAP * Until we're out of block
delline * Delete extra empty line
isemptyline jfalse 7 nextpara * Move to next para if empty line
7: firstnonwhite makectrofscreen * Pos on next para
unmarkblock restoresettings
*
* 96 bytes Sat 04-25-1992 13:54:29 (TH @f8, to DD #20/609)
* 112 bytes Sun 04-26-1992 15:43:12 (TH @f8, keep para brks, chg end pos)
* 111 bytes Tue 04-28-1992 07:59:38 (TH @f8, shortened *|b)
* 111 bytes Thu 05-07-1992 23:38:08 (TH @f8, to JB #23/1483)
* 111 bytes Thu 05-14-1992 21:35:43 (TH @f8, to JB #23/1491 -93)
*
* ----------------------------------------------------------------------
* @(f9) Format Paragraph With or W/O Multiple Indentions
* Set With @f8, @f6 or Last GoToColumn 'nn'
* ----------------------------------------------------------------------
* This macro will format a paragraph with or without multiple
* indentions to a left margin of the last entry in the "goto column"
* prompt and the current right margin setting. It may be used
* repeatedly without pausing after invoking @f8 or gotocolumn 'nn'
* return,
* To have this macro "behave" like the "WrapPara" command and
* format a paragraph from the cursor line to the end of the paragraph,
* remove "endpara prevpara" line. This macro will fit on one line of
* Qconfig.dat and requires QEdit v2.15.
* The above paragraph, without the asterisks and leading single
* spaces, formats with a left margin of 10 and a right margin of 60 to:
* This macro will format a paragraph to a left
* margin of the last entry in the "goto column"
* prompt and the current right margin setting. To
* have this macro "behave" like the "WrapPara"
* command and move/format a paragraph from the cursor
* line to the end of the paragraph, remove "endpara
* prevpara" line. This macro will fit on one line of
* Qconfig.dat and requires QEdit v2.15.
@f9 macrobegin savesettings setautoindentmode setsoundoff setscreenoff
* -------------- Position Cursor At Paragraph Begin --------------*
endpara prevpara * Remove line to act like "WordWrap" *|
* ---- Convert Paragraph To Column Block (From @5 mis003.qm) ----*
firstnonwhite * Pos on first char current line *|
unmarkblock markcolumn * Start column block *|
endline cursorleft * Make line 1 column block *|
1: cursordown jfalse 3 * Move down to next line *|
isemptyline jtrue 4 *ELSE not eof, test if end of para *|
markcolumn *ELSE not end of para, extend block *|
firstnonwhite * Move to first char *|
iscursorinblock jtrue 2 * Test if in block *|
markcolumn *ELSE not in block, extend block *|
gotoblockend cursorleft * Pos to test if past eol *|
2: isendline jtrue 1 * Test if past eol, loop again if true *|
endline cursorleft jump 1 *ELSE inlcude eol in block, loop again *|
3: addline * Para ends at eof, add empty line eof *|
4: gotoblockbeg * Pos block begin *|
* ------------------- Move Paragraph, Reformat -------------------*
begline * In case no gotocolumn setting
gotocolumn return * Goto previous "goto column" setting
moveblock * Move paragraph here finally
wrappara * Format it
nextpara makectrofscreen * Pos on next para *|
unmarkblock restoresettings
*
* 75 bytes Sat 04-25-1992 14:06:23 (TH @f9, to DD #20/609)
* 52 bytes Sun 04-26-1992 12:13:58 (TH @f9, shortened)
* 52 bytes Thu 05-14-1992 21:36:01 (TH @f9, to JB #23/1491 -93)
*
* ----------------------------------------------------------------------
* ^(f7_) Format Message Reader Paragraph
* ----------------------------------------------------------------------
* Here's a handy macro from Tim Farley of SemWare to reformat a message
* reader paragraph. Remember, paragraphs are reformatted to the width
* of the right margin setting, so set as needed. PLEASE see MSGxx.QM
* msg002.qm for @8, the most recent version of this macro.
* =========================================================================
* Date: 10-01-90 (19:09) Number: 3041 SemWare Support BBS
* To: DAN SNAPPER Refer#: 3028
* From: TIM FARLEY Read: YES
* Subj: Message reformat macro Conf: (21) ILink
* ------------------------------------------------------------------------
* DS> Does anyone have a macro to reformat a quoted 'off-line'
* DS> message paragraph and then reinsert the quotes back?
* DS>
* DS>
* DS>
* Here it is:
* Reader Paragraph Reform
* Mark a line block, hit this key, and it will reform the text, leaving
* all "II>" quoting on the left alone.
* Assumes that ">" is the last character of the "quoting" mark.
* Also assumes that WordWrap is currently on when you hit it,
* and that there is a currently marked block.
* ^f7 MacroBegin OneWindow
* GotoBlockBeg GotoBlockEnd JTrue doit MarkLine GotoBlockEnd
* doit:
* ToggleWordWrap EndLine #254 ToggleWordWrap
* GotoBlockBeg GotoColumn "16" Return Find ">" Return "BL" Return
* JTrue foundit
* BegLine
* foundit:
* CursorRight
* UnmarkBlock MarkColumn Find #254 Return "N" Return
* GotoColumn "512" Return MarkColumn BegLine GotoBlockBeg
* Cut
* MarkLine CopyBlock CopyBlock CopyBlock UnmarkBlock
* HorizontalWindow EditFile "$$$$$$$$.tmp" Return
* BegFile BegLine * Top of files in case it was already here
* InsertLine InsertLine * ??
* Paste UnMarkBlock * put block in place
* EndFile AddLine BegFile * mandatory blank line on end
* more:
* WrapPara * wrap each para
* JTrue more * until none left
* DelLine
* BegFile BegLine
* Find Return Return * find our goofy char again
* DelCh * and delete it
* GotoColumn "512" Return MarkColumn BegFile BegLine MarkColumn
* Cut Quit PrevWindow OneWindow
* Paste GotoBlockEnd CursorDown BegLine UnMarkBlock
*
* 132 bytes Tue 10-02-1990 16:51:06 (added TH)
* This macro is too long for QCONFIG, you'll have to use QMAC to
* compile it. Then put the compiled macro files in some directory,
* and add the following option to the command line your reader runs
* QEdit with:
*
* /Ld:\dir\filename.ext
*
* where D:\DIR\FILENAME.EXT is the full drive, path, and name of
* the compiled binary macro file.
*
* I've used this macro myself to reformat quotes, for over a year
* now.
*
* --Tim Farley
* SemWare Technical Support